package com.job.springSea.work0714;

import java.util.*;

/**
 * @author 于春海
 * @version 1.0
 * @since 2022-07-14 15:27:42
 */
public class UseRandom {
    public static void main(String[] args) {
        Random ran=new Random();
//        for (int i = 0; i <100 ; i++) {
//            System.out.println(ran.nextInt(100)+1);
//        }
        //给文件起名的时候 如果唯一 通常携带一串数字 16进制的 32 ......

        String fileName="面向对象总结.doc";
        for (int i = 1; i <10 ; i++) {
            String uniqueName= UUID.randomUUID().toString()+fileName;
            System.out.println(uniqueName);
        }

        String[] names={"张三","李四","王五","赵六","Lucy","jack"};
        for (int i = 1; i <=5 ; i++) {
            System.out.println("第"+i+"次 幸运者:" +names[ran.nextInt(names.length)]);
        }

    }
}